// Stub class generated by rmic, do not edit.
// Contents subject to change without notice.
package examples.iiop;
import com.healthmarketscience.rmiio.RemoteInputStream;
import java.io.IOException;
import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.UnexpectedException;
import javax.rmi.CORBA.Stub;
import javax.rmi.CORBA.Util;
import javax.rmi.PortableRemoteObject;
import org.omg.CORBA.ORB;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.ApplicationException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.RemarshalException;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.CORBA.portable.ServantObject;
public class _RemoteFileServer_Stub extends Stub implements RemoteFileServer {
private static final String[] _type_ids = {
"RMI:examples.iiop.RemoteFileServer:0000000000000000"
};
public String[] _ids() {
return _type_ids;
}
public void sendFile(RemoteInputStream arg0) throws java.rmi.RemoteException, java.io.IOException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
OutputStream out = _request("sendFile", true);
Util.writeRemoteObject(out,arg0);
_invoke(out);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
if ($_id.equals("IDL:java/io/IOEx:1.0")) {
throw (java.io.IOException) in.read_value(java.io.IOException.class);
}
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
sendFile(arg0);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("sendFile",RemoteFileServer.class);
if (so == null) {
sendFile(arg0);
return ;
}
try {
RemoteInputStream arg0Copy = (RemoteInputStream) Util.copyObject(arg0,_orb());
((RemoteFileServer)so.servant).sendFile(arg0Copy);
} catch (Throwable ex) {
Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
if (exCopy instanceof java.io.IOException) {
throw (java.io.IOException)exCopy;
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
}